home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-12-20 | 8.6 KB | 219 lines | [TEXT/MPS ] |
- #
- # ****************************************************************************
- #
- # File Name: MORE.vu
- #
- # Contains: Quick look test script for More version 3.1
- #
- # Written by: Kevin Avoy, Ken Landreth, Michael Leong, Gil Spencer et al
- #
- # Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
- #
- # ****************************************************************************
- # C h a n g e H i s t o r y (most recent first):
- # ****************************************************************************
- #
- # Vers Date Author Description
- # ---- -------- ------ ---------------------------------------------
- # <2> 12/20/93 MDS Added StandardFIle.Lib and fixed call to SaveAs().
- # <1.0.6> 12/13/93 KTA Save a file with the file name so the replaceExisting TCS will
- # pass.
- # <1.0.5> 9/30/93 KTA Initialize gFileName prior to gApptitle being updated by
- # launchTwitch().
- # <1.0.2> 6/16/93 NAGA Renaming InitGlobals(ScriptLevel)to InitGlobals(ScriptLevel)
- # <1+> 5/25/93 NAGA Adding header and porting old files to follow new standards
- #
- # ****************************************************************************
- #
-
-
-
- ########################################################################
- # External libraries
- #=======================================================================
- Libraries "StandardFile.Lib", "Output.Lib", "DoTasks.Lib","Draw.Lib","UserInterface.Lib", "Font.Lib", "Globals.Lib", "LaunchQuit.Lib", "TCS.Lib";
-
-
- #########################################################################
- ######## Application Specific Tasks
- #########################################################################
-
- #########################################################################
- # InitAppGlobals()
- #========================================================================
- # Author: KA
- # Description: Sets up tools and fonts for More. This task
- # must be called first.
- # Parameters: None
- # Returns: Nothing
- # Examples: InitAppGlobals()
- #========================================================================
- # History:
- #
- ########################################################################
- task InitAppGlobals()
- begin
-
- logstr("setting up {global gApptitle}'s globals");
- global kClick, kDrag, kMultiDrag, kMultiClickDrag, kMultiClick;
- global kPalDocWind, kPalWind, kPullOffPal, kPopUpPal, kScrollPal;
- global kToolPaletteNum := 1;
- global kPatternPaletteNum := 0;
- global kGradientPaletteNum := 0;
-
- global gWindowInset := {56,34,20,20}; # Window inset
- global gScreenInset := {0,20,0,0}; # Screen inset
- global gVoidRect := {}; # Rect not to draw in - coordinates should be RelativeToWindow
- global gTextStr;
-
- global gPaletteList := {
- { #### Start Palette # - Slide
- {0, 20, 41, 230,0}, # Location of palette relative to the window
- kPalDocWind, # Palette type
- {2,10}, # Size of Tool matrix {numElemsWide,numElemsTall}
- {19,19} # Offset between tools {h,v}
- }, #### End Palette #
- { #### Start Palette # - Outline
- {38, 53, 385, 62,0}, # Location of palette relative to the window
- kPalDocWind, # Palette type
- {19,1}, # Size of Tool matrix {numElemsWide,numElemsTall}
- {18,0} # Offset between tools {h,v}
- }, #### End Palette #
- { #### Start Palette # - Graphic
- {0, 26, 40, 195,0}, # Location of palette relative to the window
- kPalDocWind, # Palette type
- {2,4}, # Size of Tool matrix {numElemsWide,numElemsTall}
- {19,19} # Offset between tools {h,v}
- } #### End Palette #
- };
-
- ### MORE {Flag, Pattern, Line, Color}
- ### Palette Elements:= Tool#, Pal#, ToolName, ToolType, DblClktoEnd SetAttributes
- global Pointer := { 1, 1, "Pointer", kClick, 0, {0} };
- global CharTool := { 2, 1, "Char", kClick, 0, {gTextStr} };
- global RectTool := { 3, 1, "Rect", kDrag, 0, {0} };
- global OvalTool := { 4, 1, "Oval", kDrag, 0, {0} };
- global RndRectTool := { 5, 1, "RndRect", kDrag, 0, {0} };
- global LineTool := { 6, 1, "Line", kDrag, 0, {0} };
- global MultiLine := { 7, 1, "MultiLine",kMultiClick,1, {0} };
- global FreeTool := { 8, 1, "Freehand", kMultiClick,1, {0} };
-
- global OutlineMode := { 1, {111,-7,2}, "OutlineMode", 0, 0, {0} };
- global SlideMode := { 1, {126,-7,2}, "SlideMode", 0, 0, {0} };
- global OverViewMode := { 1, {142,-7,2}, "OverViewMode", 0, 0, {0} };
-
- global OutlineList:={
- Pointer,
- CharTool,
- RectTool,
- OvalTool,
- RndRectTool,
- LineTool,
- MultiLine,
- FreeTool
- };
-
- # global Tool list
- global gToolList := OutlineList;
-
- ### font characteristic lists
- global gFontSizeList := {'9','10','12','14','18', '24','36','48'};
- global gFontStyleList := {}; # custom Mdef in More - VU can't select styles
-
- ### Name of the Plain (style) menu item ####
- global gPlainStyle := ""; # Plain-Style menu item (if this is set to the actual menuitem errors occur)
-
- ### How to get to the next line
- global gNextLineMethod := 1;
- ### 1 - ReturnKey, 2 - EnterKey, 3 - DownArrow Key, 4 - TabKey, {} - Move/Click, {'Untitled'} - Move relative to the window titled 'Untitled' /Click
-
- ### Does moving to the next line clear all font info
- global gNextLineClearsFontSettings := 1;
-
- end; # InitAppGlobals
-
- #########################################################################
- # MoreExample()
- #========================================================================
- # Author: KTA (x45604)
- # Description: Enters an MORE example
- # Parameters: None
- # Returns: Nothing
- # Examples: MoreExample();
- # Assumptions: None
- # Applications: MORE
- #========================================================================
- # History:
- #
- #########################################################################
- task MoreExample() begin
- AutoList := {'Auto Purchase', 1, 'Get Loan', 1, 'Interest Rate','Principal','Payments', 2, 'Insurance','Warranty',1,'Color','Interior',1,'Stereo','Tinted Windows'};
- println;
- LogStr("MORE example");
-
- ## Make sure we are were we want to be
- SetTool(Global OutlineMode); # Go to the Outline
- SpecialKey(returnkey, 'Return key'); # Go to the next line
-
- for each item in autoList
- begin
- if(TypeOf(item) = 'string')
- begin
- TypeStr(item); # Type the next string
- type k:{returnkey}; # Go To the Next line
- end;
- else # Stagger the Data
- begin
- if (item = 1)
- SpecialKey(Tabkey, 'Tab Key'); # Move To the Right
- else if (item = 2 )
- keyEq('l'); # Move to the left
- end;
- end;
- println;
- end;
-
- ################################################################################
- #################### Main script ####################
- ################################################################################
- script More (ScriptLevel:= -1)
- begin
- InitGlobals(ScriptLevel); # initialize your general globals
- InitDraw();
- InitFonts();
- global gApptitle := "MORE";
- global gAppVersion := '3'; # version of app you will be running
- global gFileName := "@!@-{gBuildVers}-{gAppTitle}"; # This is used in SaveAs when saving files
- global gLaunchReqs := {'noCache'};
- SuiteStart('MORE.vu'); # begin a new test suite
- if LaunchTwitch("{gAppTitle}",gAliasDirectory) # launch or twitch to your app
- begin
- InitAppGlobals(); # init app specific globals
- (*
- *)
- SaveAs(Global gFileName,, 1); # So replace existing won't fail if the script hasn't been run on a HD yet.
- CloseWindow();
- SelectMenuItem('New', 'File');
-
- DoSetUpApp(,,,,1,1);
- MoreExample();
- DoText(); #Styles fail
- DoWindow(); # Vertical scroll could fail if nothing in document
- SetTool(global SlideMode);
- DoDraw();
- SetTool(global OverViewMode);
- SetTool(global OutLineMode);
- DoCloseApp(1,1);
- LogStr("############################# LIMITATIONS: ############################");
- LogStr("NOTE: Selecting Styles does not function in MORE, custom MDEF");
- end; # if LaunchTwitch("{gAppTitle}",gAliasDirectory)
- SuiteEnd();
- end; # script More
-
- ## Still needed
- # 1) If nothing is in the document the vertical scroll bar will not be enabled
- # and scrolling will not be performed as expected. DoWindow
- # 2) VU cannot select styles from the Styles menu ( VU bug??) Dotext
- # 3) Cannot Select colors, line and patterns through the popups because they disable VU.
- # 4) Plain is still selected (attempted) even though there are no styles in gFontStyleList - Dotext bug.
- # 5) Three clicks on a freehand tool will bring up a dialog - hopefully dbleClktoend is not seen as three